package cn.com.homeyoda.aimate.aihealth.ui.my.family.recommend;

import android.app.Application;

import androidx.annotation.NonNull;

import com.wzq.mvvmsmart.event.StateLiveData;

import java.util.ArrayList;
import java.util.List;

import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.base.BaseViewModel;
import cn.com.homeyoda.aimate.aihealth.bean.MemberBean;
import cn.com.homeyoda.aimate.aihealth.data.Repository;

public class RecommendViewModel extends BaseViewModel<Repository> {

    public StateLiveData<List<MemberBean>> memberData;

    public RecommendViewModel(@NonNull Application application, Repository model) {
        super(application, model);
        memberData = new StateLiveData<>();
        memberData.setValue(new ArrayList<>());
    }

    // 获取用户列表数据
    public void getUserData() {
        List<MemberBean> userList = new ArrayList<>();
        MemberBean memberBean = new MemberBean("张学友", R.mipmap.ic_member1, "58", "78", "185", "男", "无");
        MemberBean memberBean1 = new MemberBean("刘缦云", R.mipmap.ic_member2, "33", "58", "172", "女", "有");
        MemberBean memberBean2 = new MemberBean("张曼玉", R.mipmap.ic_member3, "43", "66", "168", "女", "无");
        MemberBean memberBean3 = new MemberBean("张子玉", R.mipmap.ic_member4, "18", "52", "162", "女", "有");

        userList.add(memberBean);
        userList.add(memberBean1);
        userList.add(memberBean2);
        userList.add(memberBean3);
        memberData.postSuccess();
        memberData.getValue().addAll(userList);
        memberData.postValueAndSuccess(memberData.getValue());
    }

}
